package com.ymttest.business.data;

//import javax.websocket.ContainerProvider;
//import javax.websocket.DeploymentException;
//import javax.websocket.Session;
//import javax.websocket.WebSocketContainer;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.URI;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.apache.zookeeper.server.SessionTracker.Session;

public class socket111 {

//	 ServerSocket serverSocket =new ServerSocket(10086);//1024-65535的某个端口
//	 Socket socket = serverSocket.accept();
//	 private static Map<String, WebSocket> clients = new ConcurrentHashMap<String, WebSocket>(); 
//	 
//	   private static String uri = "ws://localhost:8080/websocket/chat";
//	    private static Session session;
//	    private void start() {
//	        WebSocketContainer container = null;
//	        try {
//	            container = ContainerProvider.getWebSocketContainer();
//	        } catch (Exception ex) {
//	            System.out.println("error" + ex);
//	        }
//	        try {
//	            URI r = URI.create(uri);
//	            session = container.connectToServer(client.class, r);
//	        } catch (DeploymentException | IOException e) {
//	            e.printStackTrace();
//	        }
//	    }
//	    public static void main(String[] args) {
//	    	socket111 client = new socket111();
//	        client.start();
//	        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//	        String input = "";
//	        try {
//	            do {
//	                input = br.readLine();
//	                if (!input.equals("exit"))
//	                    client.session.getBasicRemote().sendText("javaclient"+input);
//	            } while (!input.equals("exit"));
//	        } catch (IOException e) {
//	            e.printStackTrace();
//	        }
//	    }
}
